package com.ruoyi.elase.controller;

import com.ruoyi.elase.entity.ResponseEntity;
import com.ruoyi.elase.service.CharServiceimpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;


/**
 * @author 26352
 */
@RestController
@RequestMapping("/elase")
//解决跨域
@CrossOrigin
public class ChatController {

    @Resource
    private CharServiceimpl charServiceimpl;

    //同步
    @RequestMapping("/All")
    public ResponseEntity All(){
        return charServiceimpl.All();
    }

    //ES完成敏感词过滤
    @RequestMapping("/list")
    public ResponseEntity list(@RequestParam("messageValue") String messageValue) throws IOException {
        return charServiceimpl.seach(messageValue);
    }
}
